Skip to content

Check SNI/ALPN in TLS 1.2/1.3 session resumptions#10489

Open
holtrop-wolfssl wants to merge 2 commits into
wolfSSL:masterfrom
holtrop-wolfssl:zd21798
Open

Check SNI/ALPN in TLS 1.2/1.3 session resumptions#10489
holtrop-wolfssl wants to merge 2 commits into
wolfSSL:masterfrom
holtrop-wolfssl:zd21798

Conversation

@holtrop-wolfssl
Copy link
Copy Markdown
Contributor

Description

Fixes zd#21798

Testing

How did you test?

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@holtrop-wolfssl holtrop-wolfssl self-assigned this May 14, 2026
Copilot AI review requested due to automatic review settings May 14, 2026 19:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

MemBrowse Memory Report

No memory changes detected for:

@holtrop-wolfssl
Copy link
Copy Markdown
Contributor Author

retest this please (build hung)

Copy link
Copy Markdown
Member

@julek-wolfssl julek-wolfssl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this check get performed for TLS 1.3 already? If you extend it with stateless ticket support then that should also be tested in test_tls.c.

Comment thread src/internal.c
@holtrop-wolfssl holtrop-wolfssl force-pushed the zd21798 branch 2 times, most recently from 2f5f6df to eb7226c Compare May 27, 2026 16:01
julek-wolfssl
julek-wolfssl previously approved these changes May 28, 2026
@holtrop-wolfssl
Copy link
Copy Markdown
Contributor Author

retest this please (Build wolfSSL » PRB-fips-repo-and-harness-test-v3-part2 #10052 completed: FAILURE)

@holtrop-wolfssl holtrop-wolfssl changed the title Check SNI/ALPN in TLS 1.2 stateful session ID resumption Check SNI/ALPN in TLS 1.2/1.3 session resumptions May 28, 2026
@holtrop-wolfssl
Copy link
Copy Markdown
Contributor Author

retest this please (Build wolfSSL » PRB-fips-repo-and-harness-test-v3-part2 #10054 completed: FAILURE)

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10489

Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/internal.c
XMEMCMP(curHash, session->sniHash,
TICKET_BINDING_HASH_SZ) != 0) {
WOLFSSL_MSG("Resumed session SNI mismatch, full handshake");
ssl->options.resuming = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 [High] TLS 1.2 SNI/ALPN mismatch falls through resumption setup · Logic errors

HandleTlsResumption() clears resuming on a stateful SNI/ALPN mismatch but still falls through into the live session branch, which derives keys and marks CLIENT_KEYEXCHANGE_COMPLETE instead of doing a full handshake.

Fix: Return after a binding mismatch or skip the later session-derived key setup when ssl->options.resuming is cleared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants